package com.prj.ufdm.cloud.feign.fallback;

import org.springframework.stereotype.Component;

import com.prj.ufdm.cloud.feign.bpo.FirstDemoBPO;
import com.prj.ufdm.cloud.feign.model.FirstDemo;

import feign.hystrix.FallbackFactory;

@Component
public class FirstDemoFallback implements FallbackFactory<FirstDemoBPO> {  

	@Override
	public FirstDemoBPO create(Throwable cause) {
		return new FirstDemoBPO() {
			@Override
			public FirstDemo getFirstDemoTest() { 
				System.out.println("\n  执行  fallback  Factory ..."+cause); 
				FirstDemo fd = new FirstDemo();
				fd.setErrMess(cause.toString());
				return fd;
			}
		};
	}
}
